/** \file    io_types.h
  * \brief   Definition of types used in images input/output.
  * \date    2002, 2003
  * \author  Fedor Chelnokov
  * \version $Header: /home/cscom1r4/cvsroot/cs/include/imglib/io_types.h,v 1.1 2004/02/04 14:43:24 cscom1r4 Exp $
  */

#ifndef _io_types_h_
#define _io_types_h_

#include <string>
#include <vector>
#include "typelib/types.h"

namespace img {

///storage of supported image formats (extensions)
class ext_vec: public std::vector<std::string>
{
public:
	///to human-readable view
	operator std::string() const;
	///converts ext_vec into search filter string
	std::string search_str() const;

	bool inside(const std::string &ext) const;
	bool inside(const char *ext) const
		{ return inside(std::string(ext)); }

	void unite(const ext_vec &rhs);
	void intersect(const ext_vec &rhs);
	void sort();
};

struct file_info
{
	std::string path;
	std::string format;
	size_extent dim;
	unsigned bit_count;
	bool compressed;
};

enum format_type
{
	decodable,
	encodable,
	unidir_format,	///< decodable or encodable
	bidir_format	///< decodable and encodable
};

} //namespace img

#endif //_io_types_h_
